package com.lagou.controller;

import com.lagou.bean.Person;
import com.lagou.bean.Relation;
import com.lagou.service.Neo4jPersonService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Chenyuhua
 * @date 2020/7/6 2:41
 */
@RestController
public class NeoController {

    @Resource
    private Neo4jPersonService neo4jPersonService;

    @GetMapping("/api/neo4j/get")
    public List<Relation> get(@RequestParam("startName") String startName, @RequestParam("endName") String endName) {
        return neo4jPersonService.personListDept(startName, endName);
    }
}
